package goover.unit04;

import java.io.FileWriter;
import java.io.IOException;

public class FileWriterDemo01 {
    public static void main(String[] args){
        FileWriter fw = null;
        try {
            fw = new FileWriter("D:\\JAVA\\source\\test.txt");
            fw.write("轻轻地我走了，\r\n");
            fw.write("正如我轻轻地来了！\r\n");
            fw.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                if(fw != null){
                    fw.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
